<%@ page contentType="text/html;charset=UTF-8" %>
<html>
<head>
    <title></title>
    <link rel="stylesheet" type="text/css" href="<g:createLinkTo dir="css" file="main.css"/>">
    <link rel="stylesheet" type="text/css" href="<g:createLinkTo dir="css" file="errors.css"/>">
    <link rel="stylesheet" type="text/css" href="<g:createLinkTo dir="css" file="mobile.css"/>">
    <script src="../js/jquery-2.1.0.js"></script>
    <script src="../js/application.js"></script>
</head>

<body>
<div id="form">

    <form action="<g:createLink action="createPersonAction" controller="person"/> ">
        <g:if test="${person}">
            <g:hiddenField name="id" value="${person.id}"/>

        </g:if>

        <g:formRemote name="table" url="[action: 'createPersonAction']" update="tableData">

            <g:textField name="name" placeholder="Enter name"/>

        %{--<g:if test="${person?.errors?.getFieldErrors("name")}">--}%

        %{--<text style="color: red">--}%
        %{--<g:hasErrors var="err" bean="${person.errors}" field="name">--}%

        %{--<g:message error="${person.errors.getFieldError("name")}"/>--}%

        %{--</g:hasErrors></text>--}%
        %{--</g:if>--}%

            <br>
            <g:textField name="age" placeholder="Enter age"/>

            <br>
            <g:datePicker name="date" precision="day" value="${person?.date ?: ''}"/>
            <br>
            <g:textField name="city" placeholder="Enter city"/>
            <br>
            <g:textField name="street" placeholder="Enter street"/>
            <br>
            <g:textField name="number" placeholder="Enter number"/>
            <br>
            <g:submitButton name="submit"/>

        </g:formRemote>
        <div id="tableData"></div>
</body>
</html>